package com.itheima.Mapper;

import com.itheima.pojo.Class;
import com.itheima.pojo.User;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


public interface LoginMapper {
    //根据mobile查询user,判断是否是教师
    @Select("Select * from user where mobile=#{mobile}")
    User SelectByMobile(String mobile);
    //查询ks_class
    @Select("Select * from ks_class")
    List<Class> SelectClass();
    //根据mobile和password判断登录是否成功
    @Select("Select * from user where mobile=#{name} and password=#{password}")
    User SelectByMobileAndName(User user);
    //修改老师class_id
    @Update("Update user set class_id=#{class_id} where id =#{id}")
    int updateClassIdByUserId(@Param("class_id") String class_id,@Param("id") Integer id);
}
